/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.yonsei.iwb.sdt.datastructure.tree;

import edu.yonsei.iwb.sdt.refinement.Refinement;

/**
 *
 * @author JDK
 */
public class DEdge {
    private DNode parentNode;
    private DNode childNode;
    private Refinement ref;
    private boolean edgeType;
    
    public DEdge(DNode pn, DNode cn, Refinement ref){
        this.parentNode = pn;
        this.childNode = cn;
        this.ref = ref;
        this.edgeType = ref.getBranchingType();
//        this.edgeType = type;
    }
    
    public DNode getChildNode(){
        return this.childNode;
    }
    
    public DNode getParentNode(){
        return this.parentNode;
    }
    
    public Refinement getRefinement(){
       return this.ref;
    }

    public boolean getEdgeType() {
        return edgeType;
    }    
    
    @Override
    public String toString(){
        String s= new String();
        
        s = "\n"+this.parentNode.NODE_ID + " Node  --->  " + this.childNode.NODE_ID + " Node" + "\n";
        s += ref.toString() + "\n\n";
        
        return s;
        
    }
    
    public String toGUIString(){
        String s = new String();
        s = this.ref.toString();
        return s;
    }
    
}
